<template>
  <admin-layout class="Admin">
    <div class="top">
      <h1>Admin</h1>
      <el-button type="primary" @click="$router.push({ name: 'ArticleCreate' })">添加</el-button>
    </div>
    <el-table
        :data="tableData"
        border
        style="width: 100%">
      <el-table-column
          prop="name"
          label="名字"
          width="180">
      </el-table-column>
      <el-table-column
          prop="phone"
          label="电话"
          width="180">
      </el-table-column>
      <el-table-column
          prop="address"
          label="地址">
      </el-table-column>
      <el-table-column
          prop="addtime"
          label="时间">
      </el-table-column>
    </el-table>

  </admin-layout>
</template>

<script>
const axios = require('axios');

export default {
  name: "Admin",

  data() {
    return {
      tableData:[],
    }

  },
  created () {
    this.getUser()
  },
  methods: {
    getUser() {
      const that = this
      axios.get('http://jd.kelinmen.com/index/index/getUser').then(function (res) {
        console.log(res.data.user)
        that.tableData = res.data.user
      }).catch(function (arr) {
        console.log(arr)
      })
    },

  },




};
</script>

<style scoped>
.el-table-column {
  text-align: center;
}
.top {
  display: flex;
  justify-content: space-between;
}


</style>